Skip to content

Commit

Permalink
Fix for install
Browse files Browse the repository at this point in the history
  • Loading branch information
onting committed Jul 20, 2021
1 parent 8f93f51 commit b45d300
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
24 changes: 3 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,8 @@ target_link_libraries(hanjp ${hangul_LIBRARIES})
configure_file(keyboard.xml ${CMAKE_CURRENT_BINARY_DIR}/keyboard.xml COPYONLY)
configure_file(combination.xml ${CMAKE_CURRENT_BINARY_DIR}/combination.xml COPYONLY)

set(CMAKE_CXX_STANDARD 11)

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)

# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

enable_testing()

add_executable(testing testing.cpp)
target_include_directories(testing PUBLIC ${GLib_INCLUDE_DIRS})
target_link_libraries(testing PUBLIC hanjp gtest_main ${GLib_LIBRARIES})

include(GoogleTest)
gtest_discover_tests(testing)
add_subdirectory(test EXCLUDE_FROM_ALL)

install(TARGETS hanjp DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES hanjp.h automata.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES hanjp.h automata.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES keyboard.xml combination.xml DESTINATION ${CMAKE_INSTALL_SHAREDSTATEDIR})
20 changes: 20 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
set(CMAKE_CXX_STANDARD 11)

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)

# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

enable_testing()

add_executable(testing testing.cpp)
target_include_directories(testing PUBLIC ${GLib_INCLUDE_DIRS})
target_link_libraries(testing PUBLIC hanjp gtest_main ${GLib_LIBRARIES})

include(GoogleTest)
gtest_discover_tests(testing)
File renamed without changes.

0 comments on commit b45d300

Please sign in to comment.